home *** CD-ROM | disk | FTP | other *** search
/ PC Format (UK) 188 / 01-04 PC Format 188 [2006-06] DVD side 1_.iso / DiscContents / Workshops / Workshops_Games / Sphere / InstallSphere1.0.exe / games / jonboy_kooparoids / scripts / init.js < prev    next >
Text File  |  2003-02-18  |  1KB  |  64 lines

  1. // ********************************
  2. // init.js Script
  3. // ********************************
  4.  
  5. // * * * System Includes
  6. EvaluateSystemScript("audio.js");
  7. EvaluateSystemScript("screen.js");
  8.  
  9. // * * * Custom Includes
  10. EvaluateScript("intro.js"); 
  11. EvaluateScript("fademessage_jonboy.js"); 
  12. EvaluateScript("jonboy_debug.js"); 
  13. EvaluateScript("dialog.js"); 
  14. EvaluateScript("jonboy_sprite.js"); 
  15. EvaluateScript("kooparoids.js");
  16.  
  17. // * * * Global variables
  18. var myLog;
  19. var HEAD_HEIGHT = 64;
  20. //var CONST_VIEW_WIDTH = 512;
  21. //var CONST_VIEW_HEIGHT = 384;
  22. var CONST_VIEW_WIDTH = 512+HEAD_HEIGHT;
  23. var CONST_VIEW_HEIGHT = 384;
  24. var BOARD_CENTER_X = CONST_VIEW_WIDTH/2;
  25. var BOARD_CENTER_Y = HEAD_HEIGHT + (CONST_VIEW_HEIGHT/2);
  26.  
  27. /* function Delay(milliseconds)
  28. {
  29.   var start = GetTime();
  30.   while (GetTime() - start < milliseconds);
  31. } */
  32.  
  33. // FIRST FUNCTION called by game - put calls to init routines here!
  34. function game(){
  35.   NewGame();
  36. }
  37.  
  38. function NewGame(){
  39.  
  40.   // Set up debug log
  41.   jonboy_debug_begin(1);
  42.  
  43. /**/
  44.   // Splash screen
  45.   PlaySound("evillaugh.wav");
  46.   IntroImage("KooparoidSplash02.png");
  47.   
  48.   // "BackStory"
  49.   ShowIntroStory();
  50. /**/  
  51.   
  52.   // Keep player from IMMEDIATELY escaping with ESC key
  53.   BindKey(KEY_ESCAPE, 'ExitMapEngine()', 'DoNull()');
  54.   
  55.   // Do stuff
  56.   KooparoidsPlay();  
  57.  
  58.   // Clean up and close out
  59.   AuthorSplash();
  60.   UnbindKey(KEY_ESCAPE);
  61.   
  62. }
  63.  
  64.